import execjs
import requests

url = 'https://x-quote.cls.cn/quote/stocks/basic'

# 导入js
with open('cailianshe.js', 'r',encoding="utf-8") as f:
    decryptjs = f.read()
ctx = execjs.compile(decryptjs)

sign = ctx.call('getsign')

params = {
    'app':'CailianpressWeb',
    'fields':'secu_name,secu_code,trade_status,change,change_px,last_px',
    'os':'web',
    'secu_codes':'sh000001,sz399001,sh000905,sz399006',
    'sv':'7.5.5',
    'sign':sign
}

res = requests.get(url,params=params).json()
print(res)